import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import * as ELIcons from '@element-plus/icons-vue';
import './styles/globle.less'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import VueAxios from 'vue-axios';
import { Request } from '@/service/request'
import axios from 'axios'
import { appendFile } from 'fs';
for (const name in ELIcons) {
  createApp(App).component(name, (ELIcons as any)[name])
}
createApp(App).use(store).use(router).use(ElementPlus).use(VueAxios, Request.init()).mount('#app')
router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
      document.title = String(to.meta.title)

    }
    next()
  })